package com.wude.guild.holder;

import android.app.Activity;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.mc.developmentkit.utils.MCUtils;
import com.wude.bean.PinglunBean;
import com.wude.guild.R;

import org.xutils.x;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 我的评论Holder
 * Created by Administrator on 2017/3/21.
 */

public class MyPinglunHolder extends BaseHolder<PinglunBean> {
    @BindView(R.id.icon)
    ImageView icon;
    @BindView(R.id.name)
    TextView name;
    @BindView(R.id.time)
    TextView time;
    @BindView(R.id.conte)
    TextView conte;

    @Override
    protected void refreshView(PinglunBean pinglunBean, int position, Activity activity) {
        if(pinglunBean.icon!=null&&!pinglunBean.icon.equals("")){
            MCUtils.fillImage(icon,pinglunBean.icon);
        }
        name.setText(pinglunBean.name);
        conte.setText(pinglunBean.conte);
        time.setText(MCUtils.getData(pinglunBean.time,"yyyy-MM-dd HH:mm"));
    }

    @Override
    protected View initView() {
        View inflate = LinearLayout.inflate(x.app(), R.layout.holder_mypinglun, null);
        ButterKnife.bind(this, inflate);
        inflate.setTag(this);
        return inflate;
    }
}
